using System.Linq;
using YatFram.Browser;
using YatFram.Browser.CssSelector;

namespace Examples.Google
{
    public class Homepage 
    {
        private readonly IContainerElement _homepage;

        public Homepage(IContainerElement homepage)
        {
            _homepage = homepage;
        }

        public void Search(string searchTerm)
        {
            _homepage.FindTextBox("input[name='q']").EnterText(searchTerm);
            _homepage.Find("input[name='btnG']".ToCssSelector()).First().Click();
        }
    }
}